import java.util.ArrayList;
import java.util.Random;


public class deck {
	//variables
	private ArrayList<card> myDeck;
	
	
	//constructor
	public deck(){
		myDeck= new ArrayList<card>();
		for(int i= 0; i<=13; i++){
			myDeck.add(new card(suit.CLUBS, i));
			
		}
		for(int i=0; i<=13; i++){
			myDeck.add(new card(suit.SPADES, i));
			
		}
		for(int i=0; i<=13; i++){
			myDeck.add(new card(suit.HEARTS, i));
			
		}
		for(int i=0; i<=13; i++){
			myDeck.add(new card(suit.DIAMONDS, i));
			
		}
	}
	
	//methods
	/*
	 * 
	 * draws a card and returns 
	 * 
	 */
	
	public card draw(){
		return myDeck.remove(0);
		
	}
	
	/*
	 * 
	 * shuffles decks
	 */
	
	
	public void shuffle(){
		Random gen = new Random();
		
		for(int i=0; i<300; i++){
			int selectCard = gen.nextInt(52);
			card temp = myDeck.remove(selectCard);
			myDeck.add(temp);
			
		}
		
		
	}
	
	@Override
	public String toString(){
		
		String temp = "";
		for( int i= 0; i<myDeck.size(); i++){
			temp+=myDeck.get(i).toString();
		}
		
		return temp;
		
	}
	
	
}
